﻿namespace Deppton.Mobile.Services.FilesystemHelpers
{
    using System;
    using System.Collections.Specialized;
    using System.Xml.Linq;
    using Deppton.Model;
    using Deppton.Model.Xml;
    using System.Globalization;

    public static class SurveyFilesystemHandler
    {
        public static Survey LoadFromFile(string path)
        {
            return SurveyXmlHelper.ReadFromElement(XDocument.Load(path).Root);
        }

        public static void SaveToFile(Survey survey, string path)
        {
            var document = SurveyXmlHelper.ConvertToXDocument(survey);

            document.Save(path);
        }
    }
}
